package com.example.demo.ThreadPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TestDemo02 {
    public static void main(String[] args) {
          //01创建可固定长度的线程池
        ExecutorService fixedThreadPool = Executors.newFixedThreadPool(3);
        //创建了10个线程
        for (int i = 0; i <10 ; i++) {
            int temp = i;
            fixedThreadPool.execute(()->{
                System.out.println("ThreadName"+Thread.currentThread().getName());
            });
        }
    }
}
